#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<limits.h>
#include<ctype.h>

int main()
{
	char arr[20];
	fgets(arr, 20, stdin);
	int len = strlen(arr);
	int sign = 1;
	if (arr[len - 1] == '\n')
	{
		arr[len - 1] = '\0';
		len--;
	}
	int k = 0;
	while (k < len && arr[k] == ' ')   k++;
	if (k < len)
	{
		if (arr[k] == '-')
		{
			sign = -1;
			k++;
		}
		else if (arr[k] == '+')  k++;
	}
	long long ret = 0;
	while (k < len)
	{
		if (isdigit(arr[k]))
		{
			ret = ret * 10 + arr[k] - '0';
			if (ret > 1e11)
				break;
			else
				k++;
		}
		else
			break;
	}
	ret *= sign;
	if (ret > INT_MAX)
		ret = INT_MAX;
	else if (ret < INT_MIN)
		ret = INT_MIN;
	printf("%lld\n", ret);
	return 0;
}
